home *** CD-ROM | disk | FTP | other *** search
/ Windows Expert / Windows Expert.iso / windownt / wvnsrc75.zip / WVLIST.DOC < prev    next >
Text File  |  1990-11-05  |  4KB  |  102 lines

  1. Notes on implementation of WinVN feature to check new groups:
  2.  
  3. /mrr   late October - early November 1990
  4.  
  5. WinVN uses the NNTP LIST command to determine whether new newsgroups
  6. have been created.
  7.  
  8. ==> NEWSRC FORMAT
  9.  
  10. newsrc format has been changed.  A Unix .newsrc consists entirely of
  11. lines of the form:
  12.      group{!|:} <ranges>
  13. WinVN newsrc files have these lines' format changed to
  14.      group{!|:} [s<artnum>] <ranges>
  15.  
  16. where <artnum> is the highest article number last present on the server,
  17. whether it was seen by the user or not.
  18. If the "s" entry is missing, the highest seen is assumed to be
  19. the higher number in the last range present on the line.
  20.  
  21. ==> APPEARANCE OF WINDOWS
  22.  
  23. The Net window contains one line for each newsgroup.  By convention,
  24. subscribed groups are listed first, then unsubscribed groups.
  25. Unsubscribed groups are assumed to be in alphabetical order.
  26. Subscribed groups are not assumed to be in alphabetical
  27. order, in order to accomodate the user's preferences.
  28.  
  29. Each line in the Net window consists of the name of the newsgroup,
  30. preceded by an "indicator" character which gives some status information.
  31. The indicator character is a ">" if the group name was found
  32. in the most recent string search.  Otherwise, the character is
  33. a "*" if new articles are present, a " " if no new articles
  34. are present, or a "?" if we don't know (because no LIST command
  35. was done).
  36.  
  37. Each line in a Group window consists of the Subject line of
  38. an article, preceded by an indicator character.  The indicator
  39. character is "s" if the article has been seen by the user,
  40. "n" if the article is new since the last session and hasn't been
  41. seen, or " " if the article is old and hasn't been seen.
  42.  
  43. ==> METHOD OF DETERMINING NEW NEWSGROUPS
  44.  
  45. When WinVN starts up, it reads the newsrc file and stores the
  46. information in the file in the Net document as lines in
  47. textblocks.  WinVN then asks the user whether s/he wants
  48. to check the server newsgroup status.
  49.  
  50. If so, WinVN issues a LIST command, locks
  51. all the blocks in the Net document, and
  52. allocates and builds a hash table.   The hash table contains
  53. entries indexed by a hash function based on the newsgroup name.
  54. Each entry contains a pointer to the line in the Net document
  55. containing information for that group.  Collisions are handled
  56. by the time-honored approach of choosing the next available
  57. free entry.
  58.  
  59. WinVN also allocates space for a table, NewGroupTable, to be used to store
  60. pointers to new newsgroups.
  61.  
  62. WinVN is now ready to process the LIST command.  What comes back is:
  63.  
  64. 215 <text which can be ignored>
  65. <groupname> <highest_art_#> <lowest_art_#> {y|n|m}
  66. (above line format repeated for all active newsgroups)
  67. .
  68.  
  69.  
  70. WinVN ignores the 215 line, of course.  For all the groupname
  71. lines, WinVN computes the hash function and checks to see if the
  72. group name is in the table.  (It has to check the actual name as
  73. well as the hash value to guard against collisions.  If a collision
  74. occurs, it checks the next entry.)  If the entry is found,
  75. the highest-article-on-server field is set in the group's line in the
  76. Net document.
  77.  
  78. If the entry is not found, this is a new group.
  79. A line containing the group's information in NetDoc format is
  80. created and copied to dynamically-allocated memory.  A pointer to
  81. this line is stored in NewGroupTable.
  82.  
  83. By the time the LIST's "." line is received, the Net document has 
  84. been updated for previously-known groups, and the NewGroupTable
  85. contains an unsorted list of the new groups, with lines in the same
  86. format used by the Net document.  WinVN creates a window to display
  87. this document.  The pointers in NewGroupTable are sorted so
  88. the new groups are in alphabetical order.
  89. WinVN then puts up a dialog box displaying the new groups and
  90. invites the user to select the groups to subscribe to by clicking
  91. on their names.  When the user is finished, s/he selects the "OK"
  92. button.
  93.  
  94. WinVN then merges the "new groups" lines with the Net document.
  95. It does so by inserting new subscribed groups just before the first
  96. unsubscribed group in the Net document, and inserting new unsubscribed
  97. groups just before the first unsubscribed group whose name comes after
  98. the new group in the collating sequence.
  99.  
  100. Finally, WinVN unlocks all of NetDoc and unlocks and frees
  101. the tables is has created in global memory.
  102.